﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/MARCDetails.ascx" TagName="MARCDetails" TagPrefix="MD" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="jqModal.css" rel="stylesheet" type="text/css" />

    <script src="jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="jqModal.js" type="text/javascript"></script>
    
      
    
 
    <script type="text/javascript">
        function there() {

            $("#dialog").jqm({ modal: true }).jqmShow();


        }
    
        function uploadError(sender, args) {
            var result = document.getElementById("<%= results.ClientID %>");
            result.value = "يوجد خطأ فى التحميل";
        }

        function uploadStarted(sender, args) 
        {
            
                var fileName = args.get_fileName();
               // alert(fileName);


                var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);

                if (!(fileExtension == 'mrc' || fileExtension == 'txt')) 
                        {
                            alert("mrc,txt الامتدادات المسموحة ");


                            ifIgnoreError = true;
                            sender._stopLoad();

                        }
                      

            }

        
        function uploadComplete(sender, args)
         {
            var contentType = args.get_contentType();
            var text = args.get_length() + " bytes";
            // alert(contentType);
            if (contentType.length > 0) {
                text += ", '" + contentType + "'";

            }
            var result = document.getElementById("<%= results.ClientID %>");
            result.value = text;
        }
       
    </script>
       
    <style type="text/css">
      
              .jqmWindow {
    display: none;
    
    position: fixed;
    top: 17%;
    left: 35%;
    
    margin-left: -250px;
    width: 800px;
    
    background-color: #EEE;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}

.jqmOverlay { background-color: #000; }

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWindow 
{
     position: absolute;
     
     top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
            
            </style>
</head>
<body style="font-size:12px; font-family:Times New Roman">
    <form id="form1" runat="server">
       <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
  
    
    <br />
        <br />
            <br />
             <br />
                <br />
    <div>
    <table>
    <tr>
    <td>
    
    
         <asp:AsyncFileUpload ID="AsyncFileUpload1" 
            OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete" 
            runat="server"    Width="400px"  
            UploadingBackColor="#CCFFFF"  ThrobberID="myThrobber"
             OnClientUploadStarted="uploadStarted" 
             onuploadedcomplete="AsyncFileUpload1_UploadedComplete"  />
              <asp:Label runat="server" ID="myThrobber" Style="display: none;">

                     <img align="absmiddle" alt="" src="uploading.gif" />
                     </asp:Label>
                     <br />
                     <br /> 
                     
        <asp:Label ID="results" runat="server" Text="Label"></asp:Label>
                       <br />
                       </td>
     <td>
     <a href="#" onclick="there();" >ادخل المنتج يدوياُ</a>
    </td>
    
    </tr>
    </table>
            <div dir="rtl">     
            <asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional" RenderMode="Inline" >
                    <ContentTemplate>      
        <asp:GridView ID="GridView1" runat="server"   AutoGenerateColumns="False" 
             ForeColor="#333333" DataSourceID="SqlDataSource1" 
            GridLines="None" Height="400px" Width="300px" style="margin-right: 1px" 
                     onrowcommand="GridView1_RowCommand"  
                    onrowcreated="GridView1_RowCreated"  AllowPaging="true" 
                          
                           > 
                   
                   
            <PagerSettings FirstPageText="الاولى" LastPageText="الاخيرة" 
                Mode="NextPreviousFirstLast" NextPageText="التالى" PreviousPageText="السابق" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="product" HeaderText="الكتاب/الدورية" 
                    SortExpression="product" />
                <asp:BoundField DataField="productdesc" HeaderText="الوصف" 
                    SortExpression="productdesc" />
                    <asp:BoundField DataField="auther1" HeaderText="المؤلف" 
                    SortExpression="auther1" />
                <asp:BoundField DataField="publisher" HeaderText="النشر والتوزيع" 
                    SortExpression="publisher" />
                <asp:BoundField DataField="topic" HeaderText="الموضوع" SortExpression="topic" />
                <asp:BoundField DataField="product_type" HeaderText="النوع" 
                    SortExpression="product_type" />
                <asp:BoundField DataField="issn" HeaderText="الرقم التعريفى" SortExpression="issn" />
                <asp:BoundField DataField="dwoy" HeaderText="رقم ديوى العشرى" SortExpression="dwoy" />
                <asp:BoundField DataField="lc" HeaderText="رقم تصنيف الكونجرس" SortExpression="lc" />
                
                <asp:TemplateField>
                    <HeaderTemplate>
                        عرض معلومات المارك
                    </HeaderTemplate>
                    <ItemTemplate>
                      
                        <asp:LinkButton ID="LinkButton1" runat="server" CommandName="show" CommandArgument='<%# Bind("id") %>'>عرض  المارك</asp:LinkButton>
                       <asp:PopupControlExtender ID="PopEx" runat="server" TargetControlID="GridView1" PopupControlID="Panel1"
                            Position="Center" />
                         
                            
               
                    </ItemTemplate>
                </asp:TemplateField>
                
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#1E83F2" ForeColor="#333333" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E83F2" Font-Bold="True" ForeColor="Navy" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="#ebebeb" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            
                    SelectCommand="select p.*,t.product_type from  products p INNER JOIN product_types t ON t.id = p.product_type_id"></asp:SqlDataSource>
            </div>  
    
 
        <asp:Panel ID="Panel1" runat="server" Wrap="true" BackColor="#ffffaa">
        
      <%--   <MD:MARCDetails ID="MARCDetails1" runat="server"  />--%>
        </asp:Panel>
            </ContentTemplate>
                 
                         
                </asp:UpdatePanel>
                </div>
                </div>
     
 <div class="jqmWindow" id="dialog">

<a href="#" class="jqmClose" style="background-image:url('images/close.png');
	 width:39px;
	 height:40px;
	  background-repeat:no-repeat;
	  display:block;
	  float:left;	"></a>
<hr />
     <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true">
     <ContentTemplate>
   
       <div  align="right" dir="rtl">
      <table>
       <tr>
            <td align="right">
                <asp:Label ID="lblsurname" runat="server" Text="الفاتح"></asp:Label>
            </td>
            <td align="right">
                <asp:TextBox ID="leader" runat="server" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"  
                    ErrorMessage="<%$ Resources:Resource, required %>" ControlToValidate="leader" 
                    ValidationGroup="go"></asp:RequiredFieldValidator>
               
               
                
            </td>
             <td align="right">
                    <asp:Label ID="lblfax" runat="server" Text="حقل 008 الثابت الطول"></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="fix" runat="server"></asp:TextBox>
                    
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ErrorMessage="<%$ Resources:Resource, required %>"  ControlToValidate="fix" 
                        ValidationGroup="go"></asp:RequiredFieldValidator>
   
                </td>
            <td align="right">
               <asp:Label ID="lblfirstname" runat="server" Text="النوع"></asp:Label> 
            </td>
            <td align="right">
                <asp:DropDownList ID="DropDownList1" runat="server" 
                    DataSourceID="SqlDataSource2" DataTextField="product_type" 
                    DataValueField="tag"     >
               
                   <%-- <asp:ListItem Selected="True" Value="020">كتاب</asp:ListItem>
                    <asp:ListItem Value="022">دورية</asp:ListItem>--%>
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    SelectCommand="SELECT [product_type], [tag] FROM [product_types]">
                </asp:SqlDataSource>
            </td>
            <td align="right">
                <asp:Label ID="lblposition" runat="server" Text="ردمك/ ردمد"></asp:Label>
            </td>
            <td align="right">
                <asp:TextBox ID="isn" runat="server"  Height="22px" Width="128px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ErrorMessage="<%$ Resources:Resource, required %>" ControlToValidate="isn" 
                    ValidationGroup="go"></asp:RequiredFieldValidator>
            </td>
            </tr>
            <tr align="right">
                <td align="right">
                    <asp:Label ID="lblcountry"  runat="server" Text="رقم استدعاء ديوي العشري"></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="dewey" runat="server"></asp:TextBox>
                </td>
                <td align="right">
                    <asp:Label ID="lblcity" runat="server" Text="بيانات النشر"></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="pup" runat="server"></asp:TextBox>
                </td>
               <td align="right">
                    <asp:Label ID="Label1" runat="server" Text="المؤلف"></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="auth" runat="server"></asp:TextBox>
                </td>
                <td align="right">
                    <asp:Label ID="Label3" runat="server" Text="رقم ظبط النظام "></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="f35" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
             <td align="right">
                    <asp:Label ID="lbladdress" runat="server" Text="العنوان وبيان المسئولية"></asp:Label>
                </td>
                <td align="right" >
                    <asp:TextBox ID="address" runat="server"   ></asp:TextBox>  
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
            ErrorMessage="<%$ Resources:Resource, required %>" 
            ControlToValidate="address" ValidationGroup="go"  ></asp:RequiredFieldValidator>
   
                </td>
                <td align="right">
                    <asp:Label ID="lbltele1" runat="server" Text="الوصف المادي"></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="f300" runat="server" ></asp:TextBox>
                </td>
                <td align="right">
                    <asp:Label ID="lbltele2" runat="server" Text="رأس مصطلح موضوعي"></asp:Label>
                </td>
                <td valign="top">
                    <asp:TextBox ID="topics" runat="server"></asp:TextBox>
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
            ErrorMessage="<%$ Resources:Resource, required %>" 
            ControlToValidate="topics" ValidationGroup="go" ></asp:RequiredFieldValidator>
        
                </td>
                <td align="right">
                    <asp:Label ID="lblemail1" runat="server" Text="ملاحظة عامة "></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="notes" runat="server" ></asp:TextBox>
                </td>
            </tr>
            
    <tr>
    <td align="right">
                    <asp:Label ID="Label2" runat="server" Text="رقم الاستدعاء بمكتبة الكونجرس"></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="lcs" runat="server" ></asp:TextBox>
                </td>
                 <td align="right">
                    <asp:Label ID="Label4" runat="server" Text="(تكرارية الصدور (للدوريات"></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="f310" runat="server" ></asp:TextBox>
                </td>
                 <td align="right">
                    <asp:Label ID="Label5" runat="server" Text="تاريخ اخر معالجة"></asp:Label>
                </td>
                <td align="right">
                    <asp:TextBox ID="f005" runat="server" ></asp:TextBox>
                </td>
                <td></td>
                <td></td>
    </tr>
    <tr>
   
    <td colspan="7" align="center">
    <div dir="ltr" >
     <eo:CallbackPanel runat="server" ID="CallbackPanel1" Height="230px" Width="500px" >
                  
                    <eo:Grid ID="Grid1" Width="500px" Height="220px" runat="server" ColumnHeaderDescImage="00050304"
                        BorderWidth="1px" IsCallbackByMe="False" BorderColor="#7F9DB9" Font-Size="8.75pt"
                        Font-Names="Tahoma" ColumnHeaderAscImage="00050303" GridLines="Both" FixedColumnCount="0"
                        ColumnHeaderDividerImage="00050302" GridLineColor="199, 209, 223" AllowNewItem="True"
                        FullRowMode="false" AllowPaging="True" PageSize="10">
                        <ItemStyles>
                            <eo:GridItemStyleSet>
                                <ItemHoverStyle CssText="background-color: whitesmoke"></ItemHoverStyle>
                                <CellStyle CssText="padding-left:8px;padding-top:2px;"></CellStyle>
                                <ItemStyle CssText="background-color: white"></ItemStyle>
                            </eo:GridItemStyleSet>
                        </ItemStyles>
                        <ColumnTemplates>
                            <eo:MaskedEditColumn>
                                <MaskedEdit ControlSkinID="None" TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
                                </MaskedEdit>
                            </eo:MaskedEditColumn>
                            <eo:TextBoxColumn>
                                <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma">
                                </TextBoxStyle>
                            </eo:TextBoxColumn>
                           <eo:TextBoxColumn>
                                <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma">
                                </TextBoxStyle>
                            </eo:TextBoxColumn>
                            <eo:TextBoxColumn>
                                <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma">
                                </TextBoxStyle>
                            </eo:TextBoxColumn>
                        </ColumnTemplates>
                        <Columns>
                            <eo:DeleteCommandColumn Width="40" DeleteText="الغاء" HeaderText="الغاء">
                            </eo:DeleteCommandColumn>
                            <eo:TextBoxColumn Width="240" HeaderText="الحقل" ReadOnly="false" ClientSideEndEdit="endedit_handler">
                            </eo:TextBoxColumn>
                            <eo:TextBoxColumn Width="100" HeaderText="المؤشر " ClientSideEndEdit="endedit_handler">
                            </eo:TextBoxColumn>
                            <eo:TextBoxColumn Width="100" HeaderText="التاج" ClientSideEndEdit="endedit_handler">
                            </eo:TextBoxColumn>
                            <eo:RowNumberColumn Width="20">
                            </eo:RowNumberColumn>
                        </Columns>
                        <ColumnHeaderStyle CssText="background-image:url('00050301');padding-left:8px;padding-top:2px;font-weight: bold;color:white;">
                        </ColumnHeaderStyle>
                    </eo:Grid>
                    
                </eo:CallbackPanel>
    
    </div>
    </td>
     <td colspan="1" style="color:Red;" ><h4>الحقول من دون تاج او قيمة لن تسجل</h4></td>
    </tr>
    <tr>
    <td colspan="8" align="center">
      <asp:Button ID="save" runat="server" Text="حفظ" onclick="save_Click" 
            ValidationGroup="go" />
    </td>
    </tr>
        
    </table>
    </div>
      </ContentTemplate>
     </asp:UpdatePanel>
   </div>
    
    </form>
</body>
</html>
